import request from '@/utils/request'
//重置app用户密码
export function resetAppUserPassword(data) {
  return request({
    url:'/api/user/update/password',
    method: 'post',
    data
  })
}
//编辑公墓基本信息
export function editCemeteryInfo(data) {
  return request({
    url: '/api/cemetery-info/edit-cemetery-info',
    method: 'post',
    data
  }).then((res)=>{
    return res.data;
  });
}

//获取公墓基本信息详情
export function getCemeteryInfo() {
  return request({
    url:'/api/cemetery-info/show-cemetery-info',
    method: 'get',
  })
}

// 获取墓穴类型维护表(带分页)
export function getGraveType(data) {
  return request({
    url:'/api/cemetery-graveType/grave-type',
    method: 'post',
    data
  })
}

// 新增墓穴类型
export function addGraveType(data) {
  return request({
    url:'/api/cemetery-graveType/grave-type-add',
    method: 'post',
    data
  })
}

// 根据id查询墓穴类型
export function getGraveTypeById(data) {
  return request({
    url:'/api/cemetery-graveType/grave-type-show',
    method: 'post',
    data
  })
}

// 修改墓穴类型
export function updateGraveType(data) {
  return request({
    url:'/api/cemetery-graveType/grave-type-update',
    method: 'post',
    data
  })
}

// 删除墓穴类型
export function deleteGraveType(data) {
  return request({
    url:'/api/cemetery-graveType/grave-type-delete',
    method: 'post',
    data
  })
}

// 获取app用户表(带分页)
export function getUserRecord(data) {
  return request({
    url:'/api/cemetery-app-user/app-user-list',
    method: 'post',
    data
  })
}

// 新增app用户
export function addUserType(data) {
  return request({
    url:'/api/cemetery-app-user/app-user-add',
    method: 'post',
    data
  })
}

// 根据id查询用户详情
export function getUserRecordById(data) {
  return request({
    url:'/api/cemetery-app-user/app-user-show',
    method: 'post',
    data
  })
}

// 删除app用户
export function deleteUserRecord(data) {
  return request({
    url:'/api/cemetery-app-user/app-user-delete',
    method: 'post',
    data
  })
}

// 修改是否可以登录
export function apiUpdateStatus(data) {
  return request({
    url:'/api/cemetery-app-user/app-user-update',
    method: 'post',
    data
  })
}

// 获取逝者信息(带分页)
export function getDeadInfo(data) {
  return request({
    url:'/api/cemetery-dead-info/search',
    method: 'post',
    data
  })
}

// 获取该公墓下所有园区
export function getParks() {
  return request({
    url:'/api/cemetery-dead-info/parks',
    method: 'get',
  })
}

// 殡仪馆获取该殡仪馆下所有寄存楼
export function getBuildings() {
  return request({
    url:'/api/cemetery-dead-info/building',
    method: 'get',
  })
}

// 导出模板
export function templateIn() {
  return request({
    url:'/api/excel/template/in',
    method: 'get',
  })
}

export const templateIng = '/api/excel/template/in' //历史数据模板导出

// 导出接口
export function uploadExcel(file) {
  return request({
    url:'/api/excel/upload',
    file,
    headers: {
      'Access-Control-Allow-Origin': '*',
     // 'Content-Type': 'application/x-www-form-urlencoded'
      'Content-Type': 'multipart/form-data'
    }
  })
}

//移动端操作记录
export function loadOperationRecord(data) {
  return request({
    url: '/api/Operation/records/search',
    method: 'post',
    data
  })
}

